package servlets;

import memory.*;
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

 public class Jvminfo extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
   static final long serialVersionUID = 1L;
   
   	protected void doGet(HttpServletRequest request, HttpServletResponse response)
   	throws ServletException, IOException {
		
   		JvmInformation jvmobj = new JvmInformation();
		request.setAttribute("jvmobj", jvmobj);
		assert request.getParameter("param")!=null;
   		int parametre=Integer.parseInt(request.getParameter("param"));
   		log("----------------> Parma " + parametre);
   		//int path=Integer.parseInt(request.getParameter("path"))
   		switch(parametre){
   		case 1: // correspond aux infos sur le SE
   			request.getRequestDispatcher("/osinfo.jsp").forward(request,response);
   			break;
   		case 2:// correspond aux infos sur les chemins
   			request.getRequestDispatcher("/Paths.jsp").forward(request,response);
   			break;
   		case 3:
   			request.getRequestDispatcher("/gCollector.jsp").forward(request,response);
   			break;
   		case 4:
   			request.getRequestDispatcher("/descriptionVM.jsp").forward(request,response);
   			break;
   		case 5:
   			request.getRequestDispatcher("/otherJVMInfo.jsp").forward(request,response);
   			break;
   		case 6:
   			request.getRequestDispatcher("/loadingClass.jsp").forward(request,response);
   			break;
   		default:
   			//request.getRequestDispatcher("/jvminfo.jsp").forward(request,response);
   		}
		
   	}
 }